package compound.pattern;/** * Created by Administrator on 2018-11-8. * QuackCounter是一个装饰器，实现Quackable 接口，把鸭子放进装饰器里面给鸭子多一些行为 */public class QuackCounter implements Quackable {    Quackable duck;    static int numberOfQuacks;    public void quack() {        duck.quack();        numberOfQuacks++;    }    public  QuackCounter(Quackable duck){        this.duck = duck;    }    public static int getQuacks(){        return numberOfQuacks;    }    public void registerObserver(Observer observe) {    }    public void notifyObservers() {    }}